/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.aliyuncs.devops.transform.v20210625;

import java.util.ArrayList;
import java.util.List;

import com.aliyuncs.devops.model.v20210625.ListUserDrawRecordByPkResponse;
import com.aliyuncs.devops.model.v20210625.ListUserDrawRecordByPkResponse.Lingmadata;
import com.aliyuncs.transform.UnmarshallerContext;


public class ListUserDrawRecordByPkResponseUnmarshaller {

	public static ListUserDrawRecordByPkResponse unmarshall(ListUserDrawRecordByPkResponse listUserDrawRecordByPkResponse, UnmarshallerContext _ctx) {
		
		listUserDrawRecordByPkResponse.setRequestId(_ctx.stringValue("ListUserDrawRecordByPkResponse.requestId"));
		listUserDrawRecordByPkResponse.setSuccess(_ctx.booleanValue("ListUserDrawRecordByPkResponse.success"));
		listUserDrawRecordByPkResponse.setCode(_ctx.stringValue("ListUserDrawRecordByPkResponse.code"));
		listUserDrawRecordByPkResponse.setMessage(_ctx.stringValue("ListUserDrawRecordByPkResponse.message"));

		List<Lingmadata> data = new ArrayList<Lingmadata>();
		for (int i = 0; i < _ctx.lengthValue("ListUserDrawRecordByPkResponse.data.Length"); i++) {
			Lingmadata lingmadata = new Lingmadata();
			lingmadata.setUccId(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].uccId"));
			lingmadata.setDrawGroup(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].drawGroup"));
			lingmadata.setDrawPoolName(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].drawPoolName"));
			lingmadata.setTaskGroupId(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].taskGroupId"));
			lingmadata.setAliyunPk(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].aliyunPk"));
			lingmadata.setGmtCreate(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].gmtCreate"));
			lingmadata.setDrawResult(_ctx.stringValue("ListUserDrawRecordByPkResponse.data["+ i +"].drawResult"));

			data.add(lingmadata);
		}
		listUserDrawRecordByPkResponse.setData(data);
	 
	 	return listUserDrawRecordByPkResponse;
	}
}